var PROTO_FILE_PATH = 'C:\\Users\\LIUPEIFENG\\WebstormProjects\\Netty-Learning-Nodejs\\proto\\Student.proto';
var grpc = require('grpc');
var grpcService = grpc.load(PROTO_FILE_PATH).com.lpf.generated.proto;

var server = new grpc.Server();

server.addService(grpcService.StudentService.service, {
    getRealNameByUserName: getRealNameByUserName,
    getStudentsByAge: getStudentsByAge,
    getStudentsWrapperByAges: getStudentsWrapperByAges,
    biTalk: biTalk
});

server.bind('localhost:8899', grpc.ServerCredentials.createInsecure());
server.start();

function getRealNameByUserName(call, callback) {
    console.log('username：' + call.request.username);
    callback(null, {realname: '张三'})
}

function getStudentsByAge(call, callback) {
}

function getStudentsWrapperByAges(call, callback) {
}

function biTalk(call, callback) {
}